home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / programming / oracle7 7.2 / DB / UTIL72 / DBMSPOOL.SQL < prev    next >
Encoding:
Text File  |  1995-05-09  |  5.6 KB  |  114 lines

  1. rem 
  2. rem $Header: dbmspool.sql 7020200.1 95/02/15 18:31:36 cli Generic<base> $ 
  3. rem 
  4. Rem  Copyright (c) 1991 by Oracle Corporation 
  5. Rem    NAME
  6. Rem      dbmspool.sql - dbms_shared_pool utility package.
  7. Rem    DESCRIPTION
  8. Rem      This package allows you to display the sizes of objects in the 
  9. Rem      shared pool, and mark them for keeping or unkeeping in order to
  10. Rem      reduce memory fragmentation.
  11. Rem    RETURNS
  12. Rem 
  13. Rem    NOTES
  14. Rem    MODIFIED   (MM/DD/YY)
  15. Rem     bhirano    11/30/94 -  merge changes from branch 1.2.710.3
  16. Rem     bhirano    09/27/94 -  add abort_request_threshold icd to dbms_pool
  17. Rem     adowning   02/23/94 -  split into public/private files
  18. Rem     ajasuja    01/06/94 -  merge changes from branch 1.1.312.1
  19. Rem     rkooi      04/20/93 -  change psdkeep to psdkep 
  20. Rem     ajasuja    11/05/93 -  handle UNIX addresses
  21. Rem     rkooi      12/08/92 -  Creation 
  22.  
  23. create or replace package dbms_shared_pool is
  24.   ------------
  25.   --  OVERVIEW
  26.   --
  27.   --  This package provides access to the shared pool.  This is the 
  28.   --  shared memory area where cursors and PL/SQL objects are stored.
  29.  
  30.   ----------------------------
  31.   --  PROCEDURES AND FUNCTIONS
  32.   --
  33.   procedure sizes(minsize number);
  34.   --  Show objects in the shared_pool that are larger than the specified
  35.   --    size.  The name of the object is also given which can be used as
  36.   --    an argument to either the 'keep' or 'unkeep' calls below.  You should
  37.   --    issue the SQLDBA or SQLPLUS 'set serveroutput on size xxxxx' 
  38.   --    command prior to using this procedure so that the results will
  39.   --    be displayed.
  40.   --  Input arguments:
  41.   --    minsize
  42.   --      Size, in kilobytes, over which an object must be occupying in the
  43.   --      shared pool, in order for it to be displayed.
  44.   procedure keep(name varchar2, flag char DEFAULT 'P');
  45.   --  Keep an object in the shared pool.  Once an object has been keeped in
  46.   --    the shared pool, it is not subject to aging out of the pool.  This
  47.   --    may be useful for certain semi-frequently used large objects since
  48.   --    when large objects are brought into the shared pool, a larger
  49.   --    number of other objects (much more than the size of the object 
  50.   --    being brought in, may need to be aged out in order to create a
  51.   --    contiguous area large enough.
  52.   --    WARNING:  This procedure may not be supported in the future when
  53.   --    and if automatic mechanisms are implemented to make this 
  54.   --    unnecessary.
  55.   --  Input arguments:
  56.   --    name
  57.   --      The name of the object to keep.  There are two types of objects:
  58.   --      PL/SQL objects which are specified by name, and SQL cursor
  59.   --      objects which are specified by a two-part number (indicating
  60.   --      a location in the shared pool).  For example:
  61.   --        dbms_shared_pool.keep('scott.hispackage')
  62.   --      will keep package HISPACKAGE, owned by SCOTT.  The names for
  63.   --      PL/SQL objects follows SQL rules for naming objects (i.e., 
  64.   --      delimited identifiers, multi-byte names, etc. are allowed).
  65.   --      A cursor can be keeped by
  66.   --        dbms_shared_pool.keep('0034CDFF, 20348871')
  67.   --      The complete hexadecimal address must be in the first 8 characters.
  68.   --      The value for this identifier is the concatonation of the
  69.   --      'address' and 'hash_value' columns from the v$sqlarea view.  This
  70.   --      is displayed by the 'sizes' call above.
  71.   --      Currently 'TABLE' and 'VIEW' objects may not be keeped.
  72.   --    flag
  73.   --      This is an optional parameter.  If the parameter is not specified,
  74.   --        the package assumes that the first parameter is the name of a
  75.   --        package and will resolve the name.  It can also be set to 'P' or
  76.   --        'p' to fully specify that the input is the name of a package.
  77.   --      In case the first argument is a cursor address and hash-value, the
  78.   --        parameter should be set to any character except 'P' or 'p'.
  79.   --  Exceptions:
  80.   --    An exception will raised if the named object cannot be found.
  81.   procedure unkeep(name varchar2, flag char DEFAULT 'P');
  82.   --  Unkeep the named object.
  83.   --    WARNING:  This procedure may not be supported in the future when
  84.   --    and if automatic mechanisms are implemented to make this 
  85.   --    unnecessary.
  86.   --  Input arguments:
  87.   --    name
  88.   --      The name of the object to unkeep.  See description of the name
  89.   --      object for the 'keep' procedure.
  90.   --  Exceptions:
  91.   --    An exception will raised if the named object cannot be found.
  92.   procedure aborted_request_threshold(threshold_size number);
  93.   --  Set aborted request threshold for the shared pool.
  94.   --  Input arguments:
  95.   --    threshold_size
  96.   --      The size in bytes of a request which will not try to free unpinned
  97.   --      (not "unkeep-ed") memory within the shared pool.  The range of 
  98.   --      threshold_size is  5000 to ~2 GB inclusive.   
  99.   --  Description:
  100.   --    Usually, if a request cannot be satisfied on the free list, 
  101.   --    the RDBMS will try to reclaim memory by freeing objects from the
  102.   --    LRU list and checking periodically to see if the request can be
  103.   --    fulfilled.  After finishing this step, the RDBMS has performed a near
  104.   --    equivalent of an 'alter system flush shared_pool'.  As this impacts
  105.   --    all users on the system, this procedure "localizes" the impact to the 
  106.   --    process failing to find a piece of shared pool memory of size 
  107.   --    greater than thresh_hold size.  This user will get the out of 
  108.   --    memory error without attempting to search the LRU list.
  109.   --  Exceptions:
  110.   --    An exception will be raised if threshold is not in the valid range.
  111.   --        
  112. end;
  113. /
  114.